package com.cise.searcher.utils;

import java.util.ArrayList;
import java.util.List;

import com.cise.sort.utils.AbstractResult;

public class Util {

	public static AbstractResult[] convertType(Result[] results){
		if(results != null){
			AbstractResult[] abstractResults = new AbstractResult[results.length];
			for(int i = 0; i < results.length; i++){
				abstractResults[i] = (AbstractResult)(results[i]);
			}
			return abstractResults;
		}
		else{
			return null;
		}
	}
	
	public static Result[] convertType(AbstractResult[] abstractResults){
		if(abstractResults != null){
			Result[] results = new Result[abstractResults.length];
			for(int i = 0; i < abstractResults.length; i++){
				results[i] = (Result)(abstractResults[i]);
			}
			return results;
		}
		else{
			return null;
		}
	}
	
	public static List<Result> convertType(List<AbstractResult> abstractResults){
		if(abstractResults != null){
			List<Result> results = new ArrayList<Result>();
			for(int i = 0; i < abstractResults.size(); i++){
				results.add((Result)(abstractResults.get(i)));
			}
			return results;
		}
		else{
			return null;
		}
	}
	
}
